package com.zhongfl.crm.enums.boss;

import com.zhongfl.crm.exception.CRMException;
import lombok.Getter;

/**
 * @Description: 短信发送状态
 * @Author: Mawenlei
 * @Date: 2018/4/13/013 10:57
 */
@Getter
public enum SMSSendStatus {
    /**
     * 默认
     */
    FAILED(0, "发送失败"),
    SUCCESS(1, "发送成功"),

    OTHER(999,"其他");

    private Integer key;
    private String value;

    SMSSendStatus(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static SMSSendStatus valueOf(int value) {
        for (SMSSendStatus smsSendStatus : SMSSendStatus.values()) {
            if (smsSendStatus.getKey() == value) {
                return smsSendStatus;
            }
        }
        throw new CRMException("没有在找到枚举值为" + value + "的枚举");
    }


}
